package com.liao.badminton.vo;

import com.liao.badminton.code.BaseField;
import io.swagger.annotations.ApiModelProperty;
import java.lang.String;
import java.util.Date;
import java.util.List;
import lombok.Data;
import com.liao.badminton.entity.SystemRole;
/**
* @author liaocheng
* @date 2024-11-01
* description:角色信息表
*/
@Data
public class SystemRoleVo  extends BaseField {

    @ApiModelProperty(value = "角色ID")
    private Long id;

    @ApiModelProperty(value = "角色名称")
    private String name;

    @ApiModelProperty(value = "角色权限字符串")
    private String code;

    @ApiModelProperty(value = "显示顺序")
    private Integer sort;

    @ApiModelProperty(value = "数据范围（1：全部数据权限 2：自定数据权限 3：本部门数据权限 4：本部门及以下数据权限）")
    private Integer dataScope;

    @ApiModelProperty(value = "数据范围(指定部门数组)")
    private String dataScopeDeptIds;

    @ApiModelProperty(value = "角色状态（0正常 1停用）")
    private Integer status;

    @ApiModelProperty(value = "角色类型")
    private Integer type;

    @ApiModelProperty(value = "备注")
    private String remark;

    private List<Long> delIds;  //批量删除ids

    public static SystemRoleVo invertToVo(SystemRole systemRole){
        SystemRoleVo vo = new SystemRoleVo();
        BaseField.invert(systemRole, vo);
        vo.setId(systemRole.getId());
        vo.setName(systemRole.getName());
        vo.setCode(systemRole.getCode());
        vo.setSort(systemRole.getSort());
        vo.setDataScope(systemRole.getDataScope());
        vo.setDataScopeDeptIds(systemRole.getDataScopeDeptIds());
        vo.setStatus(systemRole.getStatus());
        vo.setType(systemRole.getType());
        vo.setRemark(systemRole.getRemark());
        return vo;
    }
}
